#pragma once
#include "ToolBoxUiHandler.h"
#include "..\Common\AutoHideImpl.h"
#include "..\Common\AutoSnapImpl.h"

class CToolBoxSingleDlg 
	: public CBkDialogImpl<CToolBoxSingleDlg>
	,public CWHRoundRectFrameHelper<CToolBoxSingleDlg>
	,public CAutoSnapImpl<CToolBoxSingleDlg>, public CAutoHideImpl<CToolBoxSingleDlg, 2>
{
public:
	CToolBoxSingleDlg()
		: CBkDialogImpl<CToolBoxSingleDlg>(IDR_BK_TOOLBOXSINGLE_DLG)
	{
		m_ToolBoxHandler = new CToolBoxUiHandler(NULL,this);
	}

	~CToolBoxSingleDlg(void)
	{		
		delete m_ToolBoxHandler;
	}
protected:
	TRACKMOUSEEVENT		tmeTrack;
	BOOL				bMouseInWindow;
	bool bHide, bStartHide;
	bool bChangeStyle;
	bool bMakeTransparent;
	int		nOpacity;
protected:
	LRESULT		OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	BOOL		OnInitDialog(HWND wParam, LPARAM lParam);	
	LRESULT		OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	void		OnBkBtnClose();
	void		OnCatchScreen();	
	void		OnLockWorkStation();
	void OnMove(CPoint pt);
	void OnMouseMove(UINT ui, CPoint pt);
	void OnMouseLeave(void);
	void OnMouseHover(WPARAM wParam, CPoint pt);
	void OnTimer(UINT timerID);
	void KeepInScreen(CPoint pt);
	void WhenGoHide(void);
	
	void WhenGoShow(void);
public:
	void _init();
	CToolBoxUiHandler*				m_ToolBoxHandler;
	void SetAutoHide(BOOL bAHide)
	{
		this->bAutoHide = bAHide;
		PrepareAutoHide(bAutoHide);
	}
	void SetTransparent(BOOL bTra)
	{
		this->bMakeTransparent = bTra;
	}
	void SetOpacity(int nOp)
	{
		nOpacity = nOp;
	}
	void RefreshList();
public:
	typedef CAutoHideImpl<CToolBoxSingleDlg, 2> AutoHideClass;

	BK_NOTIFY_MAP(IDC_RICHVIEW_WIN);
		BK_NOTIFY_ID_COMMAND(IDC_BTN_SYS_CLOSE,					OnBkBtnClose)
		BK_NOTIFY_ID_COMMAND(IDC_TOOLBOX_CATCH_SCREEN,					OnCatchScreen)
		BK_NOTIFY_ID_COMMAND(IDC_TOOLBOX_LOCK_SCREEN,					OnLockWorkStation)
		

	BK_NOTIFY_MAP_END()
	BEGIN_MSG_MAP_EX_DECLARE(CToolBoxSingleDlg)
	/*BEGIN_MSG_MAP_EX(CToolBoxSingleDlg)	
		MSG_BK_NOTIFY(IDC_RICHVIEW_WIN)
		CHAIN_MSG_MAP(CBkDialogImpl<CToolBoxSingleDlg>)
		CHAIN_MSG_MAP(CWHRoundRectFrameHelper<CToolBoxSingleDlg>)
		MESSAGE_HANDLER(WM_CREATE,				OnCreate)
		MESSAGE_HANDLER(WM_DESTROY,				OnDestroy)	
		MSG_WM_INITDIALOG(OnInitDialog)	

		REFLECT_NOTIFICATIONS_EX()
	END_MSG_MAP()		*/ 


};

